﻿using DotnetSpider;
using DotnetSpider.Common;
using DotnetSpider.DataFlow.Storage;
using DotnetSpider.EventBus;
using DotnetSpider.Statistics;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Text;

namespace DSpider.Utilities
{
    public class NewsSpider : Spider
    {
        public NewsSpider(IEventBus eventBus, IStatisticsService statisticsService, SpiderOptions options, ILogger<Spider> logger, IServiceProvider services) : base(eventBus, statisticsService, options, logger, services)
        {
        }

        protected override void Initialize()
        {
            NewGuidId();
            AddDataFlow(new NewsParse()).AddDataFlow(new ConsoleStorage());
            AddRequests(new DotnetSpider.Downloader.Request("https://www.baidu.com/"));
        }
    }
}
